<?php namespace Common\Model;
use Hdphp\Model\Model;
class Goodslist extends Model
{
	protected $table = "goods_list";
	protected $validate = array(
	   array('goodslist_total','required','请填写货存',3,3),
	   array('goodslist_num','required','请填写货号',3,3),
	);
	/**
	 * 添加
	 */
	public function store()
	{		
		if(!$this->create()) return false;
		$combine = "";
		foreach($_POST['spec'] as $k=>$v)
		{
			$combine .= $v . ",";
		}
		$combine = rtrim($combine,',');
		$this->data['combine'] = $combine;
		//执行添加
		return $this->add();
	}
	/**
	 * 修改
	 */
	public function edit()
	{
		if(!$this->create()) return false;
		//执行修改
		return $this->save();
	}
}
